//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<sstream>
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first
#define Y                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)

#ifdef _DEBUG
#define eprintf(...) fprintf (stderr, __VA_ARGS__)
#else
#define eprintf(...) assert (true)
#endif

pair<double, double> F(PII a, PII b) {
	if( b.X==a.X )
		return MP(0,0);
	double A = ( (1.0*b.Y)/(1.0*b.X) - (1.0*a.Y)/(1.0*a.X) ) / (1.0*b.X - a.X);
	double B = (1.0*a.Y)/(1.0*a.X) - 1.0*A*a.X;
	return MP(A,B);
}

const double eps = 1e-10;

bool ok(PDD f, PII a) {
	double r = a.X*a.X * f.X + a.X * f.Y;
	double l = a.Y;
	return ( fabs(l-r)<eps );
}

int main()
{
	vector<int> masks;
	vector<PII> a(5);
	FOR(i,0,5)
		cin >> a[i].X >> a[i].Y;

	FOR(mask,1,1<<5) {
		int idx = -1;
		VI r;
		FOR(j,0,5) {
			if( (1<<j) & mask )
				r.PB(j);
		}

		if( SZ(r)==1 ) {
			masks.PB(mask);
			continue;
		}

		PDD f = F(a[r[0]],a[r[1]]);
		bool is = true;
		if( f.X >-eps || fabs(f.Y)<eps )
			is = false;
		FOR(i,0,SZ(r))
			if( !ok(f,a[r[i]]) )
				is = false;
		if( is )
			masks.PB(mask);
	}

	VI dp(1<<5,INF);
	dp[0] = 0;
	FOR(i,1,1<<5) {
		FOR(j,0,SZ(masks)) {
			int mask = masks[j];
			if( (mask & i) == mask) {
				int new_mask = i & (~mask);
				dp[i] = min( dp[i], dp[new_mask]+1 );
			}
		}
	}
	cout << dp[(1<<5)-1] << endl;
    return 0;
}